package com.hr.builder;

import org.springframework.stereotype.Component;

import com.espirit.eap.manager.ModelBuilderSupport;
import com.espirit.eap.pagelayout.FunctionButton;
import com.googlecode.cswish.annotation.Dependence;
import com.hr.BankCollectionItem;

@Component
@Dependence({
	"com.hr.builder.SalaryBuilder"
})
public class BankCollectionItemBuilder extends ModelBuilderSupport {
	static final String EMPLOYEE = "salary.employee";
	static final String SALARY = "salary";
	static final String AMOUNT = "salary.amount";
	static final String BANKNBR = "bankNbr";
	static final String CREATEDON = "createdOn";
	static final String CREATED = "created";
	
	@Override
	public boolean init() {
		return super.setClass(BankCollectionItem.class, "BankCollection Item", "银行托收清单");
	}

	@Override
	public void buildFields() {
		super.buildFields();
		addModelField(SALARY, "Salary", "应发工资");
		addModelField(BANKNBR, "Bank Nbr", "银行账号");
	}
	
	@Override
	protected void addSearchFields() {
		super.addSearchField(convertPropertyToField(EMPLOYEE));
	}
	
	@Override
	protected void addListFields() {
		addListField(convertPropertyToField(EMPLOYEE, BANKNBR, AMOUNT ));
	}
	
	@Override
	protected void addDetailFields() {
		addDetailField(convertPropertyToField(EMPLOYEE, BANKNBR, AMOUNT));
	}
	

	@Override
	protected void setDefaultLayoutButtons() {
		addButton(FunctionButton.EXPORT);
	}
	
}
